//
//  HotPhoneView.m
//  DaoZiJinFu
//
//  Created by woker on 16/7/26.
//  Copyright © 2016年 iwoker. All rights reserved.
//

#import "HotPhoneView.h"

@implementation HotPhoneView

+ (instancetype)showView:(UIView *)view {
    HotPhoneView *hot = [[[NSBundle mainBundle] loadNibNamed:@"HotPhoneView" owner:nil options:nil] lastObject];
    [view addSubview:hot];
    hot.hotPhoneNum.text = DZJFTel;
    [hot mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(view.mas_top);
        make.leading.equalTo(view.mas_leading);
        make.bottom.equalTo(view.mas_bottom);
        make.trailing.equalTo(view.mas_trailing);
    }];
    
    [hot readjustView];
    
    return hot;
}

- (void)readjustView {
    _alert.layer.masksToBounds = YES;
    _alert.layer.cornerRadius = 10;
    
//    _submitBtn.layer.cornerRadius = 5;
//    _submitBtn.layer.masksToBounds = YES;
//    
//    _cancelBtn.layer.cornerRadius = 5;
//    _cancelBtn.layer.masksToBounds = YES;
//    _cancelBtn.layer.borderColor = ORANGECOLOR.CGColor;
//    _cancelBtn.layer.borderWidth = 1;
}

- (IBAction)closeBtnClick:(id)sender {
    [self removeFromSuperview];
}

- (IBAction)submitClick:(id)sender {
    NSString *allString = [NSString stringWithFormat:HOTTel];
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:allString]];
}

- (IBAction)cancelBtnClick:(id)sender {
    [self removeFromSuperview];
}
@end
